#define _CRT_SECURE_NO_WARNINGS 1
/**
*      author: Y_Yao
*      created: 2024-10-07 09:49:13
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const LL INF = 1e18;
// const int INF = 0x3f3f3f3f;
//const LL INF = LLONG_MAX;
// const int INF = INT_MAX;
const int N = 2e5 + 9;
// vector<LL> dist1(2 * N,INF);
// vector<LL> dist2(2 * N,INF);

LL n;

void Dijkstra(int src, vector<LL>& dist, vector<vector<pair<LL, LL>>>& matrix)
{
    vector<bool> vis(2 * n, false);
    //memset(dist,INF,sizeof(dist));

    dist[src] = 0;

    priority_queue<pair<LL, int>, vector<pair<LL, int>>, greater<>> q;
    q.push({ 0,src });
    while (!q.empty())
    {
        auto t = q.top();
        q.pop();

        int mini = t.second;
        if (vis[mini]) continue;

        vis[mini] = true;
        for (auto e : matrix[mini])
        {
            if (!vis[e.first] && dist[mini] + e.second < dist[e.first])
            {
                dist[e.first] = dist[mini] + e.second;
                q.push({ dist[e.first],e.first });
            }
        }
    }

    // for(int i = 0;i < 2 * n;i++)
    // {
    //     LL min = INF,mini = 0;
    //     for(int j = 0;j < 2 * n;j++)
    //     {
    //         if(!vis[j] && dist[j] < min)
    //         {
    //             mini = j;
    //             min = dist[j];
    //         }
    //     }

    //     vis[mini] = true;
    //     // for(int k = 0;k < 2 * n;k++)
    //     // {
    //     //     if(!vis[k] && matrix[mini][k] != INF &&
    //     //      dist[mini] + matrix[mini][k] < dist[k])
    //     //     {
    //     //         dist[k] = dist[mini] + matrix[mini][k];
    //     //     }
    //     // }

    //     for(auto e : matrix[mini])
    //     {
    //         if(!vis[e.first] && dist[mini] + e.second < dist[e.first])
    //         {
    //             dist[e.first] = dist[mini] + e.second;
    //         }
    //     }
    // }
}

void solve()
{
    LL m, h;
    cin >> n >> m >> h;
    // vector<vector<LL>> matrix(2 * n,vector<LL>(2 * n,INF));
    vector<vector<pair<LL, LL>>> matrix(2 * n);
    LL H[h];
    for (int i = 0;i < h;i++) cin >> H[i];
    for (int i = 0;i < m;i++)
    {
        LL u, v, w;
        cin >> u >> v >> w;

        // matrix[u - 1][v - 1] = w;
        // matrix[v - 1][u - 1] = w;
        // matrix[u + n - 1][v + n - 1] = w / 2;
        // matrix[v + n - 1][u + n - 1] = w / 2;

        matrix[u - 1].push_back({ v - 1,w });
        matrix[v - 1].push_back({ u - 1,w });
        matrix[u + n - 1].push_back({ v + n - 1,w / 2 });
        matrix[v + n - 1].push_back({ u + n - 1,w / 2 });
    }
    for (int i = 0;i < h;i++) matrix[H[i] - 1].push_back({ H[i] + n - 1,0 });

    vector<LL> dist1(2 * n, INF);
    vector<LL> dist2(2 * n, INF);

    Dijkstra(0, dist1, matrix);
    Dijkstra(n - 1, dist2, matrix);

    LL ret = INF;
    for (int i = 0;i < n;i++)
    {
        ret = min(ret, max(dist1[i], dist2[i]));
        ret = min(ret, max(dist1[i], dist2[i + n]));
        ret = min(ret, max(dist1[i + n], dist2[i]));
        ret = min(ret, max(dist1[i + n], dist2[i + n]));
    }

    if (ret == INF) cout << -1 << endl;
    else cout << ret << endl;
    // cout << ret << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 0;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}